<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"><title>Barreiras Assault Cube Server</title>
</head><body style="background-color: rgb(10, 10, 10);">
<br>

<table style="text-align: left; width: 100%;" border="0"
 cellpadding="0" cellspacing="0">
  <tbody>
    <tr>
      <td style="width: 80%;">

<img style="width: 193px; height: 81px;" alt=""
 src="http://assault.cubers.net/imgs/headerLogo.png">

 </td>
<td >

 
 
 
<form method="GET" action="index.php" name="mail">
<font
 style="text-align: center; background-color: rgb(230, 230, 230);">
&nbsp;Inscreve-te no servidor barreirasac.servegame.com&nbsp;<br>
&nbsp;Nome:&nbsp;</font><input name="name"><br>
<font
 style="text-align: center; background-color: rgb(230, 230, 230);">
&nbsp;Email:&nbsp;</font><input name="mail">

<input value="ok" type="submit" />


</form>

</td>
    </tr>
    <tr>
      <td colspan="2" rowspan="1">
	  
<?php


		$con = mysql_connect("localhost","root","root");
		if (!$con)
		  {
		  die('Could not connect: ' . mysql_error());
		  }

		mysql_select_db("acscore", $con);
		
		$result = mysql_query("SELECT * FROM game order by id desc limit 0,10");

		?>
		
		
		<table  border="1"
 cellpadding="2" cellspacing="2">
  <tbody>
    <tr>
      <td><font style="text-align: center; background-color: rgb(230, 230, 230); font-weight: bold;">MAP</font></td>
      <td><font style="text-align: center; background-color: rgb(230, 230, 230); font-weight: bold;">GAME STARTED</font></td>
      <td><font style="text-align: center; background-color: rgb(230, 230, 230); font-weight: bold;">ENDED</font></td>
    </tr>


	  
	  <?php
		
		
		while($row = mysql_fetch_array($result))
		{
		  	
			echo '<tr><td><font style="text-align: center; background-color: rgb(230, 230, 230);">'
			.$row['map'] . ' </font></td><td> <font style="text-align: center; background-color: rgb(230, 230, 230);">' 
			.$row['started'] .'</font></td><td> <font style="text-align: center; background-color: rgb(230, 230, 230);">'
			.$row['ended'] . '</font></td></tr>';
			
		}
		
		

		?>
		

  </tbody>
</table>



	  
	  <?php
		
		
		echo "<br /><br /><br />";
		
		$result = mysql_query("SELECT * FROM log order by id desc limit 0,200");

		while($row = mysql_fetch_array($result))
		{
		  	echo '<font style="text-align: center; background-color: rgb(230, 230, 230);">';
			echo "&nbsp;[".$row['timestamp'] . "] " . $row['msg']."&nbsp;";
			echo '</font>';


		  
		  echo "<br />";
		}
		
		mysql_close($con);
		
		
?>
		
	  </td>
    </tr>
  </tbody>
</table>


<?php

if( isset($_GET["mail"])) {
	if(checkEmail($_GET["mail"])){

		$con = mysql_connect("localhost","root","root");
		if (!$con)
		  {
		  die('Could not connect: ' . mysql_error());
		  }

		mysql_select_db("acscore", $con);

		mysql_query("INSERT INTO mails(nome,mail) VALUES('".$_GET["name"]."', '".$_GET["mail"]."')");

		echo mysql_error();
		
		
		echo '<font style="text-align: center; background-color: rgb(230, 230, 230);">';
		echo '&nbsp;Foi inserido '.$_GET["name"]."(".$_GET["mail"].")&nbsp;";
		echo '</font>';

		mysql_close($con);
	}else{
	
		echo '<font style="text-align: center; background-color: rgb(230, 230, 230);">';
		echo "&nbsp;".$_GET["mail"]."is not a valid email&nbsp;";
		echo '</font>';
		
	}
}



function checkEmail($email) {
		  
	 $email = htmlspecialchars(stripslashes(strip_tags($email))); //parse unnecessary characters to prevent exploits
    
    if ( eregi ( '[a-z||0-9]@[a-z||0-9].[a-z]', $email ) ) { //checks to make sure the email address is in a valid format
    $domain = explode( "@", $email ); //get the domain name
        
        if ( @fsockopen ($domain[1],80,$errno,$errstr,3)) {
            //if the connection can be established, the email address is probabley valid
            return true;
            /*
            
            GENERATE A VERIFICATION EMAIL
            
            */
            
        } else {
            return false; //if a connection cannot be established return false
        }
    
    } else {
        return false; //if email address is an invalid format return false
    } 
}


?> 

</body></html>
